package com.patzn.osgi.event.admin.pub;

import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;

import java.util.HashMap;
import java.util.Map;

/**
 * @name: EmailService
 * @description: EmailService
 * @author: jiangcs
 */
public class EmailService {
    private EventAdmin eventAdmin;

    public void send() {
        Map<String, Object> map = new HashMap<>(2);
        map.put("title", "hello");
        map.put("content", "osgi event admin");
        eventAdmin.postEvent(new Event("email/10086", map));
    }

    public EventAdmin getEventAdmin() {
        return eventAdmin;
    }

    public void setEventAdmin(EventAdmin eventAdmin) {
        this.eventAdmin = eventAdmin;
    }
}
